Skip to content

Conversation

@tjvantoll
Copy link
Member

...ther an element has a widget bound to it. Fixes #77.

Thoughts on this approach?

…whether an element has a widget bound to it. Fixes jquery#77.
@jzaefferer
Copy link
Member

You could also mention that you can select all elements of a widget using the :data selector, that's usually more useful then the is check.

Tough I wonder if we actually want to document this (at least in this detail) if we're going to land that instance method?

PS: There are two double spaces in the first p element.

@tjvantoll
Copy link
Member Author

$( "#elem" ).data( "ui-progressbar" ); would become $( "elem" ).progressbar( "instance" );

But wouldn't you still need the :data selector for determining whether the current element is a widget and to get all widgets on a page?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"jQuery core's data method" -> "jQuery.data()"

@scottgonzalez
Copy link
Member

Yes, you'll still need the :data selector to find all instances. And we want to document this today (and probably even backport it to the 1.9 docs.

I think what users are really looking for though is documentation on each widget page, which can be done with an include. We'll still want these docs for the jQuery.widget entry, of course.

@tjvantoll
Copy link
Member Author

Updates made.

I can tackle adding something to the individual widget's pages next, but for now any concerns landing this? @scottgonzalez @jzaefferer

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<a href="/data-selector/">

@scottgonzalez
Copy link
Member

Looks good to me. Just update that href to have the slash.

@tjvantoll tjvantoll merged commit 4798d90 into jquery:master Feb 21, 2013
@tjvantoll tjvantoll deleted the widget_instance_docs branch February 21, 2013 00:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Document safe way to access the information of an element with a widget bound to it

3 participants